

$(function(){
    var proHTML=$('#pro .panel:first-child').prop("outerHTML");
    $('#addPro').click(function(){
        $('#pro').append(proHTML);
    });
    $("body").on('click','.closebtn',function(){
        $(this).parent().parent().remove();
    });
    $('#gongyi').click(function(){
        alert();
        $('#gy').append('<div class="gongyibox">' +
            '<div class="col-lg-2">' +
            '<div class="input-group m-b">' +
            '<span class="input-group-addon bg-info">工序</span>' +
            '<input type="text" class="form-control" required="required">' +
            '</div>' +
            '</div>' +
            '<div class="col-lg-2">' +
            '<div class="input-group m-b">' +
            '<span class="input-group-addon bg-info">工价</span>' +
            '<input type="text" class="form-control">' +
            '</div>' +
            '</div>' +
            '<div class="col-lg-2">' +
            '<div class="input-group m-b">' +
            '<span class="input-group-addon">操作工</span>' +
            '<input type="text" class="form-control">' +
            '</div>' +
            '</div>' +
            '<div class="col-lg-3" id="data_3">' +
            '<div class="input-group m-b date">' +
            '<span class="input-group-addon">要求完成时间</span>' +
            '<input type="text" class="form-control">' +
            '</div>' +
            '</div>' +
            '<div class="col-lg-3" id="data_4">' +
            '<div class="input-group m-b date">' +
            '<span class="input-group-addon">实际完成时间</span>' +
            '<input type="text" class="form-control">' +
            '</div>' +
            '</div>' +
            '<div class="gybtn">' +
            '<span class="btn btn-danger btn-sm closebtn pull-right"> x </span>' +
            '</div>' +
            '<div class="clearfix"></div>' +
            '</div>' );
    });

    $("body").on('focus','.date input',function(){
        $('.date input').datepicker({
            todayBtn: "linked",
            keyboardNavigation: false,
            forceParse: false,
            calendarWeeks: true,
            autoclose: true
        });
    });
    $('.gybtn').click(function(){
        $('this').parent('.gongyibox').remove();
    })
    $("body").on('click','.gybtn',function(){
        $('this').parent('.gongyibox').remove();
    });
    $('.search').click(function(){
        $('#cailiao').append('<div class="cailiaobox">' +
            '<div class="col-lg-2"><div class="input-group m-b">' +
            '<span class="input-group-addon">编号</span>' +
            '<input type="text" class="form-control" readonly="readonly"></div></div>' +
            '<div class="col-lg-2"><div class="input-group m-b">' +
            '<span class="input-group-addon">名称</span>' +
            '<input type="text" class="form-control" readonly="readonly"></div></div>' +
            '<div class="col-lg-2"><div class="input-group m-b">' +
            '<span class="input-group-addon">价格</span>' +
            '<input type="text" class="form-control" readonly="readonly"></div></div>' +
            '<div class="col-lg-2"><div class="input-group m-b date">' +
            '<span class="input-group-addon">进价</span>' +
            '<input type="text" class="form-control" readonly="readonly"></div></div>' +
            '<div class="col-lg-2"><div class="input-group m-b date">' +
            '<span class="input-group-addon">条形码</span>' +
            '<input type="text" class="form-control" readonly="readonly"></div></div>' +
            '<div class="col-lg-2"><div class="input-group m-b date">' +
            '<span class="input-group-addon">数量</span>' +
            '<input type="text" class="form-control"></div></div>' +
            '<div class="gybtn"><span class="closebtn pull-right">' +
            '<i class="glyphicon glyphicon-remove-sign text-info"></i></span></div>' +
            '<div class="clearfix"></div></div>')
    })

});




